<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .nav {
            /* 给浮动元素的父级添加 overflow:hidden; 即可清除浮动 */
            /* 
             优点：代码简洁
             缺点：无法显示溢出的部分
            */
            overflow: hidden;
        }

        .damao {
            width: 90px;
            height: 90px;
            background-color: red;
            float: left;
        }

        .ermao {
            width: 90px;
            height: 90px;
            background-color: gray;
            float: left;
        }

        .sanmao {
            width: 100px;
            height: 90px;
            background-color: greenyellow;
            float: left;
        }

        .zhengchang {
            height: 150px;
            background-color: maroon;
        }
    </style>
</head>

<body>
    <div class="nav">
        <div class="damao">浮动1</div>
        <div class="ermao">浮动2</div>
        <div class="sanmao">浮动3</div>
    </div>
    <div class="zhengchang"></div>
</body>

</html>